package es.gesfutbol.domini.implementacio;

import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import es.gesfutbol.domini.IQuiniela;

@Entity
@Table (name="quiniela")
public class Quiniela implements IQuiniela {

	/**
	 * 
	 */
	private static final long serialVersionUID = -9159493351468491184L;

	private Long idQuiniela;
	
	private String temporada;
	
	private Integer numJornadaQuiniela;
	
	private Date data;
	
	private boolean estaActiu;
	
	private Set<PartitDeQuiniela> partits;
	
	private Integer numEncerts15;
	
	private Integer numEncerts14;
	
	private Integer numEncerts13;
	
	private Integer numEncerts12;
	
	private Integer numEncerts11;
	
	private Integer numEncerts10;
	
	private Float premi15;
	
	private Float premi14;
	
	private Float premi13;
	
	private Float premi12;
	
	private Float premi11;
	
	private Float premi10;
	
	private Float recaudacio;
	
	private Float pot;

	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name="idQuiniela", nullable=false, precision = 10, scale=0)
	public Long getIdQuiniela() {
		return idQuiniela;
	}

	public void setIdQuiniela(Long idQuiniela) {
		this.idQuiniela = idQuiniela;
	}

	@Column(name="numJornadaQuiniela", nullable=false, precision = 10, scale=0)
	public Integer getNumJornadaQuiniela() {
		return numJornadaQuiniela;
	}

	public void setNumJornadaQuiniela(Integer numJornadaQuiniela) {
		this.numJornadaQuiniela = numJornadaQuiniela;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="data", nullable=false, length=11)
	public Date getData() {
		return data;
	}

	public void setData(Date data) {
		this.data = data;
	}
	
	@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="quiniela")
	public Set<PartitDeQuiniela> getPartits() {
		return partits;
	}

	public void setPartits(Set<PartitDeQuiniela> partits) {
		this.partits = partits;
	}

	@Column(name="temporada", length=45, nullable=false)
	public String getTemporada() {
		return temporada;
	}

	public void setTemporada(String temporada) {
		this.temporada = temporada;		
	}

	@Column(name="estaActiu", nullable=true, columnDefinition="tinyint(1) default 0")
	public boolean isEstaActiu() {
		return estaActiu;
	}

	public void setEstaActiu(boolean estaActiu) {
		this.estaActiu = estaActiu;
	}

	@Column(name="numEncerts15", nullable=true, precision = 10, scale=0)
	public Integer getNumEncerts15() {
		return numEncerts15;
	}

	public void setNumEncerts15(Integer numEncerts15) {
		this.numEncerts15 = numEncerts15;		
	}

	@Column(name="numEncerts14", nullable=true, precision = 10, scale=0)
	public Integer getNumEncerts14() {
		return numEncerts14;
	}

	public void setNumEncerts14(Integer numEncerts14) {
		this.numEncerts14 = numEncerts14;
		
	}

	@Column(name="numEncerts13", nullable=true, precision = 10, scale=0)
	public Integer getNumEncerts13() {
		 return numEncerts13;
	}

	public void setNumEncerts13(Integer numEncerts13) {
		this.numEncerts13 = numEncerts13;
		
	}

	@Column(name="numEncerts12", nullable=true, precision = 10, scale=0)
	public Integer getNumEncerts12() {
		return numEncerts12;
	}

	public void setNumEncerts12(Integer numEncerts12) {
		this.numEncerts12 = numEncerts12;		
	}

	@Column(name="numEncerts11", nullable=true, precision = 10, scale=0)
	public Integer getNumEncerts11() {
		return numEncerts11;
	}

	public void setNumEncerts11(Integer numEncerts11) {
		this.numEncerts11 = numEncerts11;		
	}

	@Column(name="numEncerts10", nullable=true, precision = 10, scale=0)
	public Integer getNumEncerts10() {
		return numEncerts10;
	}

	public void setNumEncerts10(Integer numEncerts10) {
		this.numEncerts10 = numEncerts10;		
	}

	@Column(name="recaudacio", nullable=true, precision = 6, scale=2)
	public Float getRecaudacio() {
		return recaudacio;
	}

	public void setRecaudacio(Float recaudacio) {
		this.recaudacio = recaudacio;		
	}

	@Column(name="premi15", nullable=true, precision = 6, scale=2)
	public Float getPremi15() {
		return premi15;
	}

	public void setPremi15(Float premi15) {
		this.premi15 = premi15;		
	}

	@Column(name="premi14", nullable=true, precision = 6, scale=2)
	public Float getPremi14() {
		return premi14;
	}

	public void setPremi14(Float premi14) {
		this.premi14 = premi14;		
	}

	@Column(name="premi13", nullable=true, precision = 6, scale=2)
	public Float getPremi13() {
		return premi13;
	}

	public void setPremi13(Float premi13) {
		this.premi13 = premi13;		
	}

	@Column(name="premi12", nullable=true, precision = 6, scale=2)
	public Float getPremi12() {
		return premi12;
	}

	public void setPremi12(Float premi12) {
		this.premi12 = premi12;		
	}

	@Column(name="premi11", nullable=true, precision = 6, scale=2)
	public Float getPremi11() {
		return premi11;
	}

	public void setPremi11(Float premi11) {
		this.premi11 = premi11;		
	}

	@Column(name="premi10", nullable=true, precision = 6, scale=2)
	public Float getPremi10() {
		return premi10;
	}

	public void setPremi10(Float premi10) {
		this.premi10 = premi10;		
	}

	@Column(name="pot", nullable=true, precision = 6, scale=2)
	public Float getPot() {
		return pot;
	}

	public void setPot(Float pot) {
		this.pot = pot;		
	}

	

}
